home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / www / cgi-bin / oretrieve-cgi < prev    next >
Encoding:
Text File  |  1996-11-11  |  1.2 KB  |  47 lines

  1. #!/usr/sbin/perl
  2. # $Id: oretrieve-cgi,v 1.4 1995/05/01 15:52:44 dave Exp $
  3. #
  4. # oretrieve-cgi - CGI document retreival for Oasis
  5. #
  6. # $Log: oretrieve-cgi,v $
  7. # Revision 1.4  1995/05/01  15:52:44  dave
  8. # updating to escape ALL quoted @ signs as dan said perl 5 needs since reality results are in, as well as changing all occurences of dave@sgi.com with DTjanitor@sgi.com
  9. #
  10. # Revision 1.3  1995/03/11  00:38:23  dave
  11. # not finished but need to check these in to test 'em at work
  12. #
  13. # Revision 1.1  1995/02/09  17:07:33  dave
  14. # Initial revision
  15. #
  16. #
  17.  
  18. require('cgi-lib.pl') || die "can\'t require cgi-lib.pl: $!";
  19.  
  20. $query_string = $ENV{'QUERY_STRING'};
  21. chop($server=`hostname`);
  22. $in{'debug'} = 0;
  23.  
  24. $command="/usr/sbin/oasiscmd -server $server -doc \"$query_string\" 2>&1";
  25.  
  26. print &PrintHeader;
  27.  
  28. print "<BR>Output of: $command<P>\n"            if ($in{'debug'});
  29.  
  30. open(OASIS, "-|") || exec ($command);
  31. @oasis = <OASIS>;
  32. close(OASIS);
  33.  
  34. @error = grep(/oasiscmd:/,@oasis);
  35. if (@error[0]) {
  36.     print "<HTML>\n<HEAD>\n";
  37.     print "<TITLE>Search Error</TITLE>\n";
  38.     print "</HEAD><BODY>\n";
  39.     print "<H1>ERROR</H1>\n";
  40.     print "<B>\@error[0]</B><P>\n";
  41.     print "</BODY></HTML>\n";
  42. } else {
  43.     foreach $_ (@oasis) {
  44.         print "$_";
  45.     }
  46. }
  47.